package com.bishe.dao;

import com.bishe.pojo.Message;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 消息数据层
 * @date 2022/03/20 42:08:24
 */
public interface MessageDao {

    @Select("select * from message")
    List<Message> findAll();


    @Select("select * from message where id = #{id}")
    Message findById(@Param("id") String id);

    @Delete("delete  from message where id = #{id}")
    void deleteById(@Param("id") String id);


    @Update("update message set id = #{id},title = #{title},content = #{content},createTime = #{createTime} where id = #{id}")
    void updateById(Message message);


    @Insert("insert into message (id,title,content,createTime) values(#{id},#{title},#{content},#{createTime})")
    void save(Message message);
}
